﻿using System;
using System.Linq;

class Program
{
    static int BinaryToDecimal(int number)
    {
        return Convert.ToInt32(number.ToString(), 2);
    }

    static void Main()
    {
        int number = int.Parse(Console.ReadLine());

        Console.WriteLine(BinaryToDecimal(number));

    }
}

